package com.shop2cn.iapi.wxcomponent.parameter;

public enum PayChannelStatusEnum {

    UNAUDIT(0,"待审核"),
    AUDIT_DURING(1,"审核中"),
    AUDIT_SUCCCESS(2,"已上线"),
    AUDIT_FAIL(3,"审核失败"),
    AUDIT_RETURN(4,"返回修改"),
    ;


    private int code;
    private String message;

    PayChannelStatusEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    /**
     * 通过代值获取枚举项
     *
     * @param code
     * @return
     */
    public static PayChannelStatusEnum getByCode(Integer code) {
        for (PayChannelStatusEnum payChannelStatusEnum : PayChannelStatusEnum.values()) {
            if (payChannelStatusEnum.getCode() == code) {
                return payChannelStatusEnum;
            }
        }
        return null;
    }
}
